import React, { useState, useEffect } from 'react';
import { Table } from 'antd';

export default (props: any) => {
  const { list, col, showTotal } = props;
  const [pageSize, setPageSize] = useState(10);
  return (
    <Table
      columns={props.col}
      dataSource={props.list}
      rowKey={record => record.id}
      pagination={{
        total: list.length,
        pageSize: pageSize,
        size: 'small',
        showTotal: () => {
          return `总共 ${list.length} 条记录`;
        },
      }}
    />
  );
};
